package com.fyzk.activity.trend;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.support.annotation.Nullable;
import android.util.AttributeSet;

import com.tyjc.lottery.R;
import com.fyzk.utils.LogUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by fanxs11 on 2017/9/20.
 */

public class SSCTrendView extends TrendBaseView {

    private int chooseId = R.id.trend_choose_rb2;
    private int payType = 0;

    public SSCTrendView(Context context) {
        super(context);
    }

    public SSCTrendView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public SSCTrendView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void initData() {
        rowVisibleCount = 13;
        topPaddingCount = 1;
        leftPpaddingCount = 2;
        scale = 1.0f;
        rowCount = 11;
        phaseLength = 5;
        super.initData();
    }

    @Override
    boolean isShowBottom(List<Drawinfor> infors) {
        infors.clear();
        for (int i = 0; i < 11; i++) {
            Drawinfor drawinfor = new Drawinfor();

            drawinfor.type = 0;

            if ((i+1) < 10) {
                drawinfor.text = "0"+(i+1);
            } else {
                drawinfor.text = ""+(i+1);
            }
            infors.add(drawinfor);
        }

//        return jcInfors.size() != 0;
        return false;
    }

    @Override
    protected void onDrawTop(Canvas canvas, Rect rect) {
        paintBg.setColor(topBg);
        paintTop.setColor(textColor666);
        super.onDrawTop(canvas, rect);
        Rect topRect = new Rect(rect.left,rect.top, rect.left, rect.top);
        paintLine.setColor(lineColor);
        switch (chooseId) {
            case R.id.trend_choose_rb1:
                topRect.set(topRect.left, topRect.top, topRect.left+unitLength*5,topRect.top+unitLength);
                drawText(canvas, paintTop, "开奖号码", topRect);
                canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
                topRect.set(topRect.right,topRect.top,topRect.right+unitLength*3,topRect.top+unitLength);
                drawText(canvas, paintTop, "十位", topRect);
                canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
                topRect.set(topRect.right,topRect.top,topRect.right+unitLength*3,topRect.top+unitLength);
                drawText(canvas, paintTop, "个位", topRect);
//                canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
//                topRect.set(topRect.right,topRect.top,topRect.right+unitLength*2,topRect.top+unitLength);
//                drawText(canvas, paintTop, "后三", topRect);
                break;
            case R.id.trend_choose_rb2:
            case R.id.trend_choose_rb5:
            case R.id.trend_choose_rb6:
                for (int i = 0; i < rowCount; i++) {
                    topRect.set(topRect.right, topRect.top, topRect.right+unitLength,topRect.top+unitLength);
                    String num;
                    num = ""+i;
                    drawText(canvas, paintTop, ""+num, topRect);
                    if (i < rowCount-1) {
                        canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
                    }
                }
                break;
            case R.id.trend_choose_rb3:
                switch (payType) {
                    case 7:     // 前二直选
                    case 8:    // 前三直选
                        for (int i = 0; i < rowCount; i++) {
                            topRect.set(topRect.right, topRect.top, topRect.right+unitLength,topRect.top+unitLength);
                            String num;
                            num = ""+i;
                            drawText(canvas, paintTop, ""+num, topRect);
                            if (i < rowCount-1) {
                                canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
                            }
                        }
                        break;
                    default:
                        String[] titles = {"30期","50期","100期","遗漏"};
                        for (int i = 0; i < titles.length; i++) {
                            topRect.set(topRect.right, topRect.top, (int) (topRect.right+unitLength*2.75),topRect.top+unitLength);
                            String num = ""+titles[i];
                            drawText(canvas, paintTop, ""+num, topRect);
                            if (i < titles.length-1) {
                                canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
                            }
                        }
                        break;
                }
                break;
            case R.id.trend_choose_rb4:
                switch (payType) {
                    case 3:
                    case 7:
                    case 8:
                        for (int i = 0; i < rowCount; i++) {
                            topRect.set(topRect.right, topRect.top, topRect.right+unitLength,topRect.top+unitLength);
                            String num;
                            num = ""+i;
                            drawText(canvas, paintTop, ""+num, topRect);
                            if (i < rowCount-1) {
                                canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
                            }
                        }
                        break;
                    default:
                        topRect.set(topRect.left, topRect.top, topRect.left+unitLength*5,topRect.top+unitLength);
                        drawText(canvas, paintTop, "开奖号码", topRect);
                        canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
//                        topRect.set(topRect.right,topRect.top,topRect.right+unitLength*2,topRect.top+unitLength);
//                        drawText(canvas, paintTop, "大小比", topRect);
//                        canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
                        topRect.set(topRect.right,topRect.top,topRect.right+unitLength*3,topRect.top+unitLength);
                        drawText(canvas, paintTop, "奇偶比", topRect);
                        canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
                        topRect.set(topRect.right,topRect.top,topRect.right+unitLength*3,topRect.top+unitLength);
                        drawText(canvas, paintTop, "质合比", topRect);

                        break;
                }
                break;
            default:
                break;
        }

        paintLine.setColor(textDefault);
        canvas.drawLine(rect.left, rect.bottom-1, rect.right, rect.bottom-1, paintLine);
    }

    @Override
    protected void onDrawLeft(Canvas canvas, int left, int top) {
        if (chooseId == R.id.trend_choose_rb3 && payType != 7 && payType != 8) {
            for (int i = 0; i < columnCount; i++) {
                rectCenter.left = left;
                rectCenter.right = rectCenter.left + leftWidth;
                rectCenter.top = top + i*unitLength;
                rectCenter.bottom = rectCenter.top + unitLength;

                if (i % 2 == 0) {
                    paintBg.setColor(bgBai);
                } else {
                    paintBg.setColor(bgHui);
                }
                canvas.drawRect(rectCenter, paintBg);
                canvas.drawLine(rectCenter.left, rectCenter.bottom, rectCenter.right, rectCenter.bottom, paintLine);
                String num = "";
                num = ""+i;
                if (i < 10) {
                    paintCircle.setColor(redColor);
                    paintCircle.setStyle(Paint.Style.FILL);
                    canvas.drawCircle(rectCenter.centerX(), rectCenter.centerY(), rectCenter.height()/2-4, paintCircle);
                    paintText.setColor(Color.WHITE);
                    drawText(canvas, paintText, ""+num, rectCenter);
                }
                canvas.drawLine(rectCenter.right-1, rectCenter.top, rectCenter.right-1, rectCenter.bottom, paintLine);
            }
            if (drawHeight > unitLength*columnCount) {
                Rect bgRect = new Rect(left, top+columnCount*unitLength, leftWidth, top+drawHeight);
                paintBg.setColor(bgBai);
                canvas.drawRect(bgRect, paintBg);
                canvas.drawLine(bgRect.right-1, bgRect.top, bgRect.right-1, bgRect.bottom, paintLine);
            }
        } else {
            super.onDrawLeft(canvas, left, top);
        }
    }

    @Override
    protected void onDrawBottom(Canvas canvas, Rect rect) {
        super.onDrawBottom(canvas, rect);
        int prizeNumWidth = 0;   // 开奖号码占据的宽度

        Rect chooseNumRect = new Rect(rect.left+prizeNumWidth,rect.top,rect.right,rect.top+rect.height()*2/3);
        Rect alreadyChooseNumRect = new Rect(rect.left+prizeNumWidth+getScrollX(),rect.top+rect.height()/2,rect.right,rect.bottom);

        Rect numRect = new Rect(alreadyChooseNumRect.left,alreadyChooseNumRect.top,alreadyChooseNumRect.left+unitLength*2/3,alreadyChooseNumRect.bottom);
        for (int i = 0; i < bottomInfors.size(); i++) {
            Drawinfor drawinfor = bottomInfors.get(i);
            Rect redNumRect = new Rect(chooseNumRect.left+unitLength*(i),chooseNumRect.top,chooseNumRect.left+unitLength*(i+1),chooseNumRect.bottom);
            drawinfor.rect = redNumRect;

            if (drawinfor.type == 0) {
                paintCircle.setColor(redColor);
            } else {
                paintCircle.setColor(blueColor);
            }

            if (drawinfor.isCheck) {
                paintText.setColor(Color.WHITE);
                paintCircle.setStyle(Paint.Style.FILL);

                drawText(canvas, paintCircle, drawinfor.text, numRect);
                numRect = new Rect(numRect.right, numRect.top, numRect.right+unitLength*2/3,numRect.bottom);
            } else {
                paintText.setColor(paintCircle.getColor());
                paintCircle.setStyle(Paint.Style.STROKE);
            }
            canvas.drawCircle(redNumRect.centerX(), redNumRect.centerY(), redNumRect.width()/2-4, paintCircle);

            drawText(canvas, paintText, drawinfor.text, redNumRect);

        }
    }

    @Override
    protected void onDrawCenter(Canvas canvas, int left, int top) {
        leftAndTopTitle = "期号";
        switch (chooseId) {
            case R.id.trend_choose_rb1:
                drawCenterPrize(canvas, left, top);
                break;
            case R.id.trend_choose_rb2:
                drawCenterTrend(canvas, left, top);
                break;
            case R.id.trend_choose_rb3:
                if (payType == 7 || payType == 8) {
                    drawCenterTrend(canvas, left, top);
                } else {
                    leftAndTopTitle = "号码";
                    drawCenterHot(canvas, left, top);
                }
                break;
            case R.id.trend_choose_rb4:
                if (payType == 3 || payType == 7 || payType == 8) {
                    drawCenterTrend(canvas, left, top);
                } else {
                    drawCenterShap(canvas, left, top);
                }
                break;
            default:
                drawCenterTrend(canvas, left, top);
                break;
        }
    }

    private void drawCenterBg(Canvas canvas, int left, int top, int i) {
        Rect bgRect = new Rect(left, top+i*unitLength, drawWidth, top+(i+1)*unitLength);
        if (i % 2 == 0) {
            paintBg.setColor(bgBai);
        } else {
            paintBg.setColor(bgHui);
        }

        canvas.drawRect(bgRect, paintBg);
        paintLine.setColor(textDefault);
        canvas.drawLine(bgRect.left, bgRect.bottom, bgRect.right, bgRect.bottom, paintLine);
    }

    // 开奖
    private void drawCenterPrize(Canvas canvas, int left, int top) {
        // 数据
        List<TrendBean.IssuesBean> infors = new ArrayList<>();
        if (trendBean != null && trendBean.getIssues() != null && trendBean.getIssues().size() > 0) {
            infors = trendBean.getIssues();
        }

        Rect topRect = new Rect(left,top,left,top);
        for (int i = 0; i < columnCount; i++) {
            String windCode = "";
            String shiValue = "";
            String geValue = "";
            String houSanValue = "";
            if (infors != null && i < infors.size()) {
                TrendBean.IssuesBean infor = infors.get(i);
                try {
                    windCode = infor.getWincode();
                    String[] windNums = windCode.split(" ");
                    if (windNums.length == 5) {
                        int shiNum = Integer.parseInt(windNums[3]);
                        shiValue = (shiNum >= 5 ? "大" : "小") + (shiNum % 2 == 0 ? "双" : "单");
                        int geNum = Integer.parseInt(windNums[4]);
                        geValue = (geNum >= 5 ? "大" : "小") + (geNum % 2 == 0 ? "双" : "单");
                    }

                } catch (NumberFormatException e) {
                    LogUtil.e(e.getMessage());
                }
            }
            topRect.set(left,topRect.bottom,left,topRect.bottom+unitLength);
            drawCenterBg(canvas, left, top, i);

            paintLine.setColor(lineColor);
            paintText.setColor(redColor);
            topRect.set(topRect.left, topRect.top, topRect.left+unitLength*5,topRect.top+unitLength);
            drawText(canvas, paintText, windCode, topRect);
            canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
            paintText.setColor(textColorMiss);
            topRect.set(topRect.right,topRect.top,topRect.right+unitLength*3,topRect.top+unitLength);
            drawText(canvas, paintText, shiValue, topRect);
            canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
            topRect.set(topRect.right,topRect.top,topRect.right+unitLength*3,topRect.top+unitLength);
            drawText(canvas, paintText, geValue, topRect);
//            canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
//            topRect.set(topRect.right,topRect.top,topRect.right+unitLength*2,topRect.top+unitLength);
//            drawText(canvas, paintText, houSanValue, topRect);
        }
    }

    // 走势
    private void drawCenterTrend(Canvas canvas, int left, int top) {
        List<TrendBean.IssuesBean> infors = new ArrayList<>();
        if (trendBean != null && trendBean.getIssues() != null && trendBean.getIssues().size() > 0) {
            infors = trendBean.getIssues();
        }
        // 数据
        Rect topRect = new Rect(left,top,left,top);
        List<Drawinfor> drawinfors = new ArrayList<>();
        int endIndext = 0;
        for (int i = 0; i < columnCount; i++) {
            String windCode = "- - - - -";
            List<String> missValues = new ArrayList<>();
            if (missInfors.size() > 0) {
                missValues = missInfors.get(i);
                if (isTJ) {
                    endIndext = missInfors.size()-4;
                } else {
                    endIndext = missInfors.size();
                }

            }
            try {
                if (i < infors.size()) {
                    windCode = infors.get(i).getWincode();
                    windCode = windCode.replace(" ", "");
                }

                switch (payType) {
                    case 2:
                        windCode = windCode.substring(windCode.length()-2, windCode.length());
                        break;
                    case 4:
                    case 5:
                    case 6:
                        windCode = windCode.substring(windCode.length()-3, windCode.length());
                        break;
                    default:
                        windCode = "- - - - -";
                        break;
                }
            } catch (Exception e) {

            }

            drawCenterBg(canvas, left, top, i);
            topRect.set(left,topRect.bottom,left,topRect.bottom+unitLength);
            if (i == missInfors.size()-4) {
                paintLine.setColor(textDefault);
                canvas.drawLine(left, topRect.top, drawWidth, topRect.top, paintLine);
            }
            paintLine.setColor(lineColor);

            for (int j = 0; j < rowCount; j++) {
                topRect.set(topRect.right, topRect.top, topRect.right+unitLength,topRect.top+unitLength);
                String num = ""+j;
                if (missValues.size() > 0) {
                    if (i >= endIndext) {
                        num = ""+missValues.get(j);
                    } else {
                        if (missValues.get(j).equals("0")) {
                            Drawinfor drawinfor = new Drawinfor();
                            num = ""+j;

                            drawinfor.text = num;
                            drawinfor.findCount = appearNumber(windCode, num);
                            drawinfor.rect = new Rect(topRect.left, topRect.top, topRect.right, topRect.bottom);
                            drawinfor.shapType = 0;
                            drawinfor.textColor = Color.WHITE;
                            drawinfor.shapColor = redColor;
                            drawinfors.add(drawinfor);
                        }
                        if (isYL) {
                            num = ""+missValues.get(j);
                        } else {
                            num = "";
                        }
                    }
                    if (i == missInfors.size()-4) {
                        paintTop.setColor(color_showCount);
                    } else if (i == missInfors.size() - 3) {
                        paintTop.setColor(color_average);
                    } else if (i == missInfors.size() - 2) {
                        paintTop.setColor(color_maxMiss);
                    } else if (i == missInfors.size() - 1) {
                        paintTop.setColor(color_maxLian);
                    } else {
                        paintTop.setColor(textColorMiss);
                    }
                }
                drawText(canvas, paintTop, ""+num, topRect);
                if (j < rowCount-1) {
                    canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
                }
            }
            if (i == columnCount - 1) {
                switch (payType) {
                    case 0:
                    case 1:
                    case 3:
                    case 7:
                    case 8:
                        drawShap(canvas, drawinfors, isZX);
                        break;
                    default:
                        drawShap(canvas, drawinfors, false);
                        break;
                }
            }
        }
    }
    private int appearNumber(String srcText, String findText) {
        int count = 0;
        int index = 0;
        while ((index = srcText.indexOf(findText, index)) != -1) {
            index = index + findText.length();
            count++;
        }
        return count;
    }

    // 冷热
    private void drawCenterHot(Canvas canvas, int left, int top) {
        List<TrendBean.HcsBean> hcsInfors = new ArrayList<>(); // 冷热
        if (trendBean != null && trendBean.getHcs() != null && trendBean.getHcs().size() > 0) {
            hcsInfors = trendBean.getHcs();
        }
        // 遗漏数据
        List<TrendBean.MissesBean> infors = new ArrayList<>();
        if (trendBean != null && trendBean.getMisses() != null && trendBean.getMisses().size() > 0) {
            infors = trendBean.getMisses();
        }
        List<Integer> missValues = new ArrayList<>();
        if (infors.size() > 0) {
            missValues = infors.get(infors.size()-1).getMissValues(missTitle);
        }

        Rect topRect = new Rect(left,top,left,top);
        for (int i = 0; i < columnCount; i++) {
            drawCenterBg(canvas, left, top, i);

            topRect.set(left,topRect.bottom,left,topRect.bottom+unitLength);
            paintLine.setColor(lineColor);

            int rCount = 4;
            for (int j = 0; j < rCount; j++) {
                String num = "";
                if (hcsInfors.size() > 0) {
                    if (j < hcsInfors.size()) {
                        TrendBean.HcsBean hcsInfor = hcsInfors.get(j);
                        List<Integer> hcValues = hcsInfor.getHcValues(hcTitle);
                        if (i < hcValues.size()) {
                            num = ""+hcValues.get(i);
                            if (hcValues.get(i) == hcsInfor.maxHc) {
                                paintTop.setColor(redColor);
                            } else {
                                paintTop.setColor(textColorMiss);
                            }
                        }
                    } else {
                        if (i<missValues.size()){
                            num = ""+missValues.get(i);
                            if (missValues.get(i) == infors.get(infors.size()-1).maxMiss) {
                                paintTop.setColor(redColor);
                            } else {
                                paintTop.setColor(textColorMiss);
                            }
                        }
                    }
                }
                topRect.set(topRect.right, topRect.top, (int) (topRect.right+unitLength*2.75),topRect.top+unitLength);
                drawText(canvas, paintTop, ""+num, topRect);
                if (j < 3) {
                    canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
                }
            }
        }

        if (drawHeight > unitLength*columnCount) {
            Rect bgRect = new Rect(left, top+columnCount*unitLength, drawWidth, top+drawHeight);
            paintBg.setColor(bgBai);
            canvas.drawRect(bgRect, paintBg);
        }
    }

    // 形态
    private void drawCenterShap(Canvas canvas, int left, int top) {
        Rect topRect = new Rect(left,top,left,top);
        // 数据
        List<TrendBean.IssuesBean> infors = new ArrayList<>();
        if (trendBean != null && trendBean.getIssues() != null && trendBean.getIssues().size() > 0) {
            infors = trendBean.getIssues();
        }

        topRect = new Rect(left,top,left,top);
        for (int i = 0; i < columnCount; i++) {
            String windCode = "";
            String bigSmall = "";
            String oddEven = "";
            String prime = "";
            if (infors != null && i < infors.size()) {
                TrendBean.IssuesBean infor = infors.get(i);
                windCode = infor.getWincode();
                bigSmall = infor.getBigsmall();
                oddEven = infor.getOddEvenValue();
                prime = infor.getPrimeValue();
            }
            drawCenterBg(canvas, left, top, i);

            topRect.set(left, topRect.bottom, left, topRect.bottom + unitLength);
            paintLine.setColor(lineColor);
            paintTop.setColor(redColor);

            topRect.set(topRect.left, topRect.top, topRect.left+unitLength*5,topRect.top+unitLength);
            drawText(canvas, paintTop, windCode, topRect);
            canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
            paintTop.setColor(textColorMiss);
//            topRect.set(topRect.right,topRect.top,topRect.right+unitLength*2,topRect.top+unitLength);
//            drawText(canvas, paintTop, bigSmall, topRect);
//            canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
            topRect.set(topRect.right,topRect.top,topRect.right+unitLength*3,topRect.top+unitLength);
            drawText(canvas, paintTop, oddEven, topRect);
            canvas.drawLine(topRect.right-1, topRect.top, topRect.right-1, topRect.bottom, paintLine);
            topRect.set(topRect.right,topRect.top,topRect.right+unitLength*3,topRect.top+unitLength);
            drawText(canvas, paintTop, prime, topRect);
        }

    }

    @Override
    public void onChooseClick(int id) {
        chooseId = id;
        setRowCount(10);
        switch (id) {
            case R.id.trend_choose_rb1:
                setColumnCount(50, false);
                break;
            case R.id.trend_choose_rb2:
                setColumnCount(50, false);
                break;
            case R.id.trend_choose_rb3:
                switch (payType) {
                    case 7:
                    case 8:
                        setColumnCount(50, false);
                        break;
                    default:
                        setColumnCount(10, true);
                        break;
                }
                break;
            case R.id.trend_choose_rb4:
                setColumnCount(50, false);
                break;
            default:
                break;
        }
        setMissTitle(chooseId, payType);
//        recording();
//        setScrollY(0);
//        invalidate();
    }

    @Override
    public void onChangePayType(int id) {
        payType = id;
        setMissTitle(chooseId, payType);
    }

    private void setMissTitle(int chooseId, int payType) {
        hcTitle = "hc";
        switch (chooseId) {
            case R.id.trend_choose_rb2:
                switch (payType) {
                    case 0:
                        missTitle = "ge";
                        break;
                    case 1:
                        missTitle = "shi";
                        break;
                    case 2:
                        missTitle = "miss";
                        break;
                    case 3:
                        missTitle = "bai";
                        break;
                    case 7:
                    case 8:
                        missTitle = "wan";
                        break;
                    default:
                        missTitle = "miss";
                        break;
                }
                break;
            case R.id.trend_choose_rb3:
                switch (payType) {
                    case 0:
                        hcTitle = "ge";
                        break;
                    case 1:
                        hcTitle = "shi";
                        break;
                    case 2:
                        hcTitle = "hc";
                        break;
                    case 3:
                        hcTitle = "bai";
                        break;
                    case 7:
                    case 8:
                        missTitle = "qian";
                        break;
                    default:
                        missTitle = "miss";
                        hcTitle = "hc";
                        break;
                }
                break;
            case R.id.trend_choose_rb4:
                switch (payType) {
                    case 0:
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                    case 6:
                        hcTitle = "ge";
                        break;
                    case 3:
                    case 7:
                    case 8:
                        missTitle = "bai";
                        break;
                    default:
                        missTitle = "miss";
                        break;
                }
                break;
            case R.id.trend_choose_rb5:
                switch (payType) {
                    case 1:
                    case 3:
                    case 7:
                    case 8:
                        missTitle = "shi";
                        break;
                    default:
                        missTitle = "miss";
                        break;
                }
                break;
            case R.id.trend_choose_rb6:
                switch (payType) {
                    case 1:
                    case 3:
                    case 7:
                    case 8:
                        missTitle = "ge";
                        break;
                    default:
                        missTitle = "miss";
                        break;
                }
                break;
            default:
                break;
        }
        setMissInfors(payType, chooseId);
    }

    @Override
    protected void setColumn(int paytype, int chooseId) {
        if (paytype == 1 || paytype == 3 || paytype == 7 || paytype == 8) {
            switch (chooseId) {
                case R.id.trend_choose_rb2:
                case R.id.trend_choose_rb3:
                case R.id.trend_choose_rb4:
                case R.id.trend_choose_rb5:
                case R.id.trend_choose_rb6:
                    if (isTJ) {
                        columnCount = missInfors.size();
                    } else {
                        columnCount = missInfors.size() - 4;
                    }
                    break;
                default:
                    columnCount = missInfors.size();
                    break;
            }
        } else {
            switch (chooseId) {
                case R.id.trend_choose_rb2:
                    if (isTJ) {
                        columnCount = missInfors.size();
                    } else {
                        columnCount = missInfors.size() - 4;
                    }
                    break;
                default:
                    columnCount = missInfors.size();
                    break;
            }
        }

    }
}
